<?php

namespace common\services\cms;

use common\services\BaseService;
use common\repositories\cms\DirRepository;

class DirService extends BaseService {

    private $_dirRepository;

    public function __construct($config = []) {
        $this->_dirRepository = new DirRepository();
        parent::__construct($config);
    }

    public function getDirList($where = []) {
        return $this->_dirRepository->getDirList($where);
    }

    public function getDirById($id) {
        return $this->_dirRepository->getDirById($id);
    }

    public function existsDir($id){
        return $this->_dirRepository->existsDir($id);
    }

    /**
     * 设置是否对外显示
     * @param $id 文章id
     * @param $status  显示状态
     * @return bool
     */
    public function displaySet($id, $status)
    {
        return $this->_dirRepository->displaySet($id, $status);
    }

}
